import request from "@/utils/request.js";

/**
 * 基础设置-获取全部基础分类
 */
export function getBaseSetting(data) {
    return request({
        url: `/jy-business/commodityBaseConfig/getCommodityBaseConfig`,
        method: "get"
    });
}

/**
 * 基础设置-编辑分类选项
 */
export function editBaseSetting(data) {
    return request({
        url: `/jy-business/commodityBaseConfig/updateCommodityBaseConfig`,
        method: "post",
        data
    });
}
/**
 * 查询所有自定义属性
 */
export function getAllCommodityExtraAttributes(data) {
    return request({
        url: `/jy-business/commodityExtraAttributesConfig/getAllCommodityExtraAttributes`,
        method: "get"
    });
}
/**
 * 禁用-开启 自定义属性
 */
export function changeAllCommodityExtraAttributes(data) {
    return request({
        url: `/jy-business/commodityExtraAttributesConfig/disabledCommodityExtraAttributes`,
        method: "post",
        data
    });
}
/**
 * 新增-编辑 自定义属性
 */
export function editCommodityExtraAttributes(data) {
    return request({
        url: `/jy-business/commodityExtraAttributesConfig/commodityExtraAttributes`,
        method: "post",
        data
    });
}


/**
 * 诊断列表
 * @param {Object} params 
 * @returns 
 */
export const diagnosticList = () => {
    return request({
        url:'/jy-business/diagnosis/config/query',
        method:'get',
    })
}


/**
 * 更新，编辑配置
 * @param {Object} data 
 * @returns 
 */
export const addOrEditDialog = (data) => {
    return request({
        url:'/jy-business/diagnosis/config/save',
        method:'post',
        data
    })
}


/**
 * 删除配置
 * @param {Object} data 
 * @returns 
 */
export const deleteSetting = (data) => {
    return request({
        url:'/jy-business/diagnosis/config/delete',
        method:'post',
        data
    })
}


/**
 * 诊断排序
 * @param {Array} data 
 * @returns 
 */
export const diagSort = (data) => {
    return request({
        url:'/jy-business/diagnosis/config/sort/save',
        method:'post',
        data
    })
}

/**
 * 根据父id查询二级目录是否重名及是否超量
 * @param {string} parentId 父级id
 */
export const queryNameAndQuantity = (data) => {
    return request({
        url:'/jy-business/commodityBaseConfig/queryNameAndQuantity',
        method:'post',
        data
    })
}